<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>DependentResult (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>

  <script type="text/javascript" src="//www.google.com/jsapi"></script>
  <script type="text/javascript">
     google.load("visualization", "1", {packages:["orgchart"]});
     var _loadingVisualizations = true;
  </script>

  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
        <span class="fn">result.DependentResult</span>
        <span>Extends</span>
        <span class="fn-name">
          <a href="interface_goog_result_Result.html">
          goog.result.Result
</a>
        </span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    A DependentResult represents a Result whose eventual value depends on the
value of one or more other Results. For example, the Result returned by

  </div>


        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="goog.result.chain or @see goog.result.combine is dependent on the
Results given as arguments.">Also See:</a></li>
            <li><a href="local_closure_goog_result_dependentresult.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
            <li><a href="http://code.google.com/p/closure-library/source/browse/local/closure/goog/result/dependentresult.js">Git</a></li>
          </ol>
        </div>
</div>






<h2 class="g-first">Inheritance</h2>
<div class='gviz-org-chart-container goog-inline-block'>
<table class='gviz-org-chart' style='display:none'>
  <tr><td><span class="type"><a href="interface_goog_Thenable.html">goog.Thenable</a></span></td><td></td></tr>
  <tr><td><span class="type"><a href="interface_goog_result_Result.html">goog.result.Result</a></span></td><td><span class="type"><a href="interface_goog_Thenable.html">goog.Thenable</a></span></td></tr>
  <tr><td>goog.result.DependentResult</td><td><span class="type"><a href="interface_goog_result_Result.html">goog.result.Result</a></span></td></tr>
</table>
</div>
<div class='gviz-org-chart-container goog-inline-block'>
<table class='gviz-org-chart' style='display:none'>
</table>
</div>




  <h2>Constructor</h2>
      <div class="fn-constructor">
    goog.result.DependentResult(<span></span>)
  </div>



<h2>Instance Methods</h2>


  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>







<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="interface_goog_result_DependentResult.html">
              goog.result.DependentResult
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.result.DependentResult.prototype.getParentResults"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getParentResults<span class="args">()</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span>!</span><span class="type"><a href="interface_goog_result_Result.html">goog.result.Result</a></span>&gt;
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span>!</span><span class="type"><a href="interface_goog_result_Result.html">goog.result.Result</a></span>&gt;&nbsp;
            A list of Results which will affect
    the eventual value of this Result. The returned Results may themselves
    have parent results, which would be grandparents of this Result;
    grandparents (and any other ancestors) are not included in this list.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_result_dependentresult.js.source.html#line45">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>

<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="interface_goog_result_Result.html">
              goog.result.Result
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.result.Result.prototype.cancel"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">cancel<span class="args">()</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Cancels the current Result, invoking the canceler function, if set.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether the Result was canceled.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_result_result_interface.js.source.html#line97">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.result.Result.prototype.getError"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getError<span class="args">()</span>
        </span>
        &#8658; <span class="type">*</span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type">*</span>&nbsp;
            The error slug for this Result. Will return undefined if the
    Result was a success, the error slug was not set, or if the Result is
    pending.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_result_result_interface.js.source.html#line89">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.result.Result.prototype.getState"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getState<span class="args">()</span>
        </span>
        &#8658; <span>!</span><span class="type">goog.result.Result.State</span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type">goog.result.Result.State</span>&nbsp;
            The state of this Result.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_result_result_interface.js.source.html#line74">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.result.Result.prototype.getValue"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getValue<span class="args">()</span>
        </span>
        &#8658; <span class="type">*</span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type">*</span>&nbsp;
            The value of this Result. Will return undefined if the Result is
    pending or was an error.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_result_result_interface.js.source.html#line81">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.result.Result.prototype.isCanceled"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">isCanceled<span class="args">()</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether this Result was canceled.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_result_result_interface.js.source.html#line103">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.result.Result.prototype.wait"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">wait<span class="args">(<span class="arg">handler</span>,&nbsp;<span class="arg">opt_scope</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Attaches handlers to be called when the value of this Result is available.
Handlers are called in the order they were added by wait.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">handler</span>
        : <span>!</span><span class="type">function(this:T, !goog.result.Result</span>)
        <div class="entryOverview">The function called
    when the value is available. The function is passed the Result object as
    the only argument.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_scope</span>
        : <span class="type">T=</span>
        <div class="entryOverview">Optional scope for the handler.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_result_result_interface.js.source.html#line50">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>

<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="interface_goog_Thenable.html">
              goog.Thenable
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.Thenable.prototype.then"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">then<span class="args">(<span class="arg">opt_onFulfilled</span>,&nbsp;<span class="arg">opt_onRejected</span>,&nbsp;<span class="arg">opt_context</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_Promise.html">goog.Promise</a></span>.&lt;<span class="type">RESULT</span>&gt;
      </div>


     <div class="entryOverview">
       Adds callbacks that will operate on the result of the Thenable, returning a
new child Promise.

If the Thenable is fulfilled, the <code> onFulfilled</code> callback will be
invoked with the fulfillment value as argument, and the child Promise will
be fulfilled with the return value of the callback. If the callback throws
an exception, the child Promise will be rejected with the thrown value
instead.

If the Thenable is rejected, the <code> onRejected</code> callback will be invoked
with the rejection reason as argument, and the child Promise will be rejected
with the return value of the callback or thrown value.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">opt_onFulfilled</span>
        : <span>?</span>(<span class="type">function(this:THIS, TYPE):
               (RESULT</span><span>&nbsp;|&nbsp;</span><span class="type">IThenable</span>.&lt;<span class="type">RESULT</span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Thenable))=</span>
        <div class="entryOverview">A
    function that will be invoked with the fulfillment value if the Promise
    is fullfilled.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_onRejected</span>
        : <span>?</span>(<span class="type">function(*): *)=</span>
        <div class="entryOverview">A function that will be invoked
    with the rejection reason if the Promise is rejected.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_context</span>
        : <span class="type">THIS=</span>
        <div class="entryOverview">An optional context object that will be the
    execution context for the callbacks. By default, functions are executed
    with the default this.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_Promise.html">goog.Promise</a></span>.&lt;<span class="type">RESULT</span>&gt;&nbsp;
            A new Promise that will receive the result
    of the fulfillment or rejection callback.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_promise_thenable.js.source.html#line57">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>




















<div class="section">
  <table class="horiz-rule">


  </table>
</div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>
      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Package result</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">Package Reference</h2>
            <div id="sideTypeIndex" rootPath="" current="result.DependentResult"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
